package models

import (
	"github.com/beego/beego/v2/client/orm"
	_ "github.com/go-sql-driver/mysql"
)

type SysCustomerBlack struct {
	Id    uint64
	Phone string
	AppId string
}

func RegisterBlaskList() {
	orm.RegisterModel(new(SysCustomerBlack))
}

func JudgeBlackList(appId, number string) bool {

	result := &SysCustomerBlack{}

	o := orm.NewOrm()
	err := o.QueryTable("SysCustomerBlack").Filter("Phone", number).Filter("AppId", appId).One(result)
	if err != nil {
		return false
	}

	return true
}
